/* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
/* Copyright (C) 2012 Zongyou Yao. All rights reserved.     */

#ifndef SET_INCLUDED
#define SET_INCLUDED

typedef struct set_t *set_t;

set_t set_new(int hint, int cmp(const void *x, const void *y), unsigned hash(const void *x));
void set_free(set_t *set);
int set_length(set_t set);
int set_member(set_t set, const void *member);
void set_put(set_t set, const void *member);
void *set_remover(set_t set, const void *member);
void set_map(set_t set, void apply(const void *member, void *cl), void *cl);
void **set_toarray(set_t set, void *end);

set_t set_union(set_t s, set_t t);
set_t set_inter(set_t s, set_t t);
set_t set_minus(set_t s, set_t t);
set_t set_diff(set_t s, set_t t);

#endif
